package com.demo;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@Slf4j
@SpringBootTest
@RunWith(SpringRunner.class)
public class FlowableDeploy {

    @Autowired ProcessEngine processEngine;
    @Autowired RepositoryService repositoryService;
    @Autowired RuntimeService runtimeService;
    @Autowired TaskService taskService;

    @Test
    public void testDeploy() {
        String flowId = repositoryService.createDeployment()
                .addClasspathResource("online_demo.bpmn20.xml")
                .name("线上沟通-演示流程-部署")
                .deploy().getId();
        log.info("flowId: {}", flowId);
    }
}
